package com.example.msg.handler;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class MsgHandler {
    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void send(String routingkey,String jsonMsg) {
        this.rabbitTemplate.convertAndSend("msg.exchange",routingkey, jsonMsg);
    }
}
